]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Animate the appearance of new windows after overview closes
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Thu, 17 Sep 2020 07:25:49 +0000 (15:25 +0800)
committerDaniel van Vugt <daniel.van.vugt@canonical.com>
Thu, 19 Aug 2021 07:53:57 +0000 (15:53 +0800)
So that the animation doesn't get skipped if the overview is visible but
in the process of closing.

In this case the overview being visible also means that it is closing,
because if it's visible and not already closing then `_shouldAnimateActor`
would have returned false and exited `_mapWindow` earlier.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1814,
       https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3242

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1440>

js/ui/windowManager.js

index 2ded68236222f134dd287120f67d61b057e66e0e..48fa9a5934c54fd2bd59ac8c694cc925a705924e 100644 (file)
@@ -1446,7 +1446,19 @@ var WindowManager = class {
         dimmer.setDimmed(false, this._shouldAnimate());
     }
 
-    _mapWindow(shellwm, actor) {
+    _waitForOverviewToHide() {
+        if (!Main.overview.visible)
+            return Promise.resolve();
+
+        return new Promise(resolve => {
+            const id = Main.overview.connect('hidden', () => {
+                Main.overview.disconnect(id);
+                resolve();
+            });
+        });
+    }
+
+    async _mapWindow(shellwm, actor) {
         actor._windowType = actor.meta_window.get_window_type();
         actor._notifyWindowTypeSignalId =
             actor.meta_window.connect('notify::window-type', () => {
@@ -1488,6 +1500,7 @@ var WindowManager = class {
             actor.show();
             this._mapping.add(actor);
 
+            await this._waitForOverviewToHide();
             actor.ease({
                 opacity: 255,
                 scale_x: 1,
@@ -1505,6 +1518,7 @@ var WindowManager = class {
             actor.show();
             this._mapping.add(actor);
 
+            await this._waitForOverviewToHide();
             actor.ease({
                 opacity: 255,
                 scale_x: 1,